<?php
namespace Helpers;

class XhException extends \Exception
{

    protected $description;

    public function __construct($message = '', $description = '', $code = 0)
    {
        $this->message      = $message;
        $this->description  = $description;
        $this->code         = $code;
    }

    final public function getDescription($jsonEncode = false)
    {
        return $jsonEncode ? json_encode($this->description) : $this->description;
    }

}